import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Arrays;

public class Main {
   public static void main(String[] args) throws UnknownHostException {

      // 获取本机IP地址对象
      InetAddress address = InetAddress.getLocalHost();
      // 获取本机地址
      System.out.println(address.getHostAddress());
   }
}